package mn.asri.teaproc.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.ServiceDefTarget;

public interface PocRpcService extends RemoteService {

	/**
	 * Utility/Convenience class. Use PocRpcService.App.getInstance() to access
	 * static instance of PocRpcServiceAsync
	 */
	class App {

		private static PocRpcServiceAsync ourInstance = null;

		private App() {}

		public static synchronized PocRpcServiceAsync getInstance() {
			if (ourInstance == null) {
				ourInstance =
					(PocRpcServiceAsync) GWT.create(PocRpcService.class);
				((ServiceDefTarget) ourInstance).setServiceEntryPoint(
					GWT.getModuleBaseURL() + "PocRpcService");
			}
			return ourInstance;
		}
	}

	PocPayload receiveInitialQuestion();

	PocPayload sendAnswerAndReceiveQuestion(PocPayload answer);
}
